package com.example.tse.rbyair.dialog;

import android.app.Dialog;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;

import com.example.tse.rbyair.R;

public class RbProgressDialog extends DialogFragment {

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {

        final Dialog dialog = new Dialog(getActivity(), android.R.style.Theme_Translucent_NoTitleBar);
        dialog.setContentView(R.layout.dialog_check_update);

        Window window = dialog.getWindow();
        WindowManager.LayoutParams wlp = window.getAttributes();
//        window.setWindowAnimations(R.style.dialogWindowAnim); //设置窗口弹出动画

        wlp.width = WindowManager.LayoutParams.WRAP_CONTENT;
        wlp.height = WindowManager.LayoutParams.WRAP_CONTENT;//DensityUtils

        wlp.gravity = Gravity.CENTER;


        window.setAttributes(wlp);

//        dialog.setCanceledOnTouchOutside(true);

        return dialog;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.dialog_check_update, container);


        return view;
    }


}

